//
//  FQDPhotoViewerNavBar.m
//  FakeQDaily
//
//  Created by mewxiv on 9/1/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDPhotoViewerNavBar.h"

#import "Masonry.h"

@implementation FQDPhotoViewerNavBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    self.backgroundColor = [UIColor blackColor];
    
    UIImage *backImage = [UIImage imageNamed:@"back"];
    _backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _backButton.frame = CGRectMake(0, 15, 40.0f, 40.0f);
    [_backButton setImage:backImage forState:UIControlStateNormal];
    [self addSubview:_backButton];
    
    _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
    _titleLabel.font = FQDRegularFontWithSize(17.0f);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = [UIColor whiteColor];
    _titleLabel.text = @"0 / 0";
    _titleLabel.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
    [self addSubview:_titleLabel];
    
    UIImage *downloadImage = [UIImage imageNamed:@"article_detaile_shoBigImage_down"];
    _downloadButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _downloadButton.frame = CGRectMake(self.bounds.size.width-30, 25, 19, 19);
    [_downloadButton setImage:downloadImage forState:UIControlStateNormal];
    [self addSubview:_downloadButton];
}

@end
